import request from '@/utils/request'


// 登录方法
export const login = (user) => {
    return request.post("/user/login", user);
};

// 注册方法
export const register = (user) => {
    return request.post("/user/register", user);
};

// 获取用户列表
export const getUsers = (params) => {
    return request.get("/system/users", { params });
};

// 根据ID获取用户
export const getUserById = (userId) => {
    return request.get(`/system/user/${userId}`);
};

// 保存用户
export const saveUser = (user) => {
    return request.post("/system/user/save", user);
};

// 删除用户
export const deleteUser = (ids) => {
    return request.post("/system/user/delete", ids);
};

// 更新用户状态
export const updateStatus = (id, status) => {
    return request.post("/system/updateStatus", { id, status });
};

// 检查用户名
export const checkUserName = (user) => {
    return request.post("/system/checkUserName", user);
};

// 重置密码
export const resetPassword = (userId) => {
    return request.get(`/system/resetPassword/${userId}`);
};
